<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>
<?php 
	$ci = & get_instance();
	$tid = intval($_GET['tid']);
	$TOURNAMENT = $ci->tournament_entity->init("id", $tid);
	if(mCrypt($tid) != $_GET['scrid'] ){
		redirect(site_url());exit();
	}	 
	if($TOURNAMENT->getStatus() == 'closed' || $TOURNAMENT->getStatus() == 'cancelled'){
		redirect(site_url('cricket/tournament/tournament_closed_notify'));exit();
	}
?>
<div id="center_content">
	
	<div class="clrboth"></div>
	<?php $this->load->view('cricket/cricket/countdown_timeend_of_tournament2'); ?>
	<div class="clrboth"></div>	

	<div class="sepDIV"></div>
	
	<div class="clrboth"></div>
	<?php $this->load->view('cricket/cricket/live_matches_of_tournament'); ?>
	<div class="clrboth"></div>

	<div class="sepDIV"></div>
	
	<div class="clrboth"></div>
	<?php $this->load->view('cricket/cricket/upcoming_matches_of_tournament'); ?>
	<div class="clrboth"></div>	

	<div class="sepDIV"></div>
	
	<div class="clrboth"></div>
	<div id="closed-matches-of-tournament">
		<?php $this->load->view('cricket/cricket/closed_matches_of_tournament'); ?>
	</div>
	<div class="clrboth"></div>	
</div>


<script type="text/javascript">
	google.setOnLoadCallback(function() {
		$('#sys_plugin_my_profile').removeClass('hidden');
		//setInterval("doReload()",600000);
		$('#closed-matches-of-tournament #closedMatchesDivId a').live('click',function(){
			$link = $(this).attr('href'); 
			$('#closed-matches-of-tournament').addClass('greyDiv');
			$.get($link, {},function(res){
				$('#closed-matches-of-tournament').html(res);
				$('#closed-matches-of-tournament').removeClass('greyDiv');
				return false;
			});
			return false;
		});
	});
	
</script>